import 'package:dk_flutter_base/dk_ui.dart';
import 'package:dk_flutter_base/dk_core.dart';

class SectionWidget extends StatelessWidget {
  //主标题
  final String title;
  //副标题
  final String subTitle;
  final bool bottomLineHidden;
  SectionWidget(
      {this.title = "", this.subTitle = "", this.bottomLineHidden = true});
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      child: Row(
        children: <Widget>[
          SizedBox(
            width: 16,
            height: 0,
          ),
          Expanded(
            child: Container(
              //width: double.infinity,
              child: Row(
                children: <Widget>[
                  Text(
                    this.title,
                    style: TextStyle(color: Color(0xFF333333), fontSize: 14),
                  ),
                  Opacity(
                    opacity: stringNotEmpty(this.subTitle) ? 1 : 0,
                    child: Padding(
                      padding: const EdgeInsets.only(left: 5),
                      child: Text(
                        this.subTitle,
                        style: TextStyle(color: Color(0xFF999999), fontSize: 14),
                      ),
                    ),
                  )
                ],
              ),
              padding: EdgeInsets.only(top: 17, bottom: 17),
              decoration: BoxDecoration(
                border: this.bottomLineHidden ? null : Border(bottom: Divider.createBorderSide(context,color: Color(0xFFEBEBEB),width: 0.5))
              ),
            ),
          ),
        ],
      ),
    );
  }
}
